import { allRouter } from '@/utils/recursion-router'

const Order = () => import('@/view/order-manage/index.vue');
const OrderList = () => import('@/view/order-manage/order-list/index.vue');
const ProductManage = () => import('@/view/order-manage/product-manage/index.vue');
const ProductionList = () => import('@/view/order-manage/product-manage/production-list/index.vue');
const ReviewManage = () => import('@/view/order-manage/product-manage/review-manage/index.vue');
const ReturnGoods = () => import('@/view/order-manage/return-goods/index.vue');

const Goods = () => import('@/view/goods-manage/index.vue')
const GoodsList = () => import('@/view/goods-manage/goods-list/index.vue')
const GoodsClassify = () => import('@/view/goods-manage/goods-classify/index.vue')


/* 需要权限判断的路由 */
const dynamicRoutes: Array<allRouter> = [
  {
    path: "/order",
    component: Order,
    name: "order-manage",
    meta: {
      name: "订单管理",
      icon: "Tickets",
    },
    children: [
      {
        path: "list",
        name: "order-list",
        component: OrderList,
        meta: {
          name: "订单列表",
          icon: "Document",
        },
        children: []
      },
      {
        path: "product",
        name: "product-manage",
        component: ProductManage,
        meta: {
          name: "生产管理",
          icon: "Cpu",
        },
        children: [
          {
            path: "list",
            name: "product-list",
            component: ProductionList,
            meta: {
              name: "生产列表",
              icon: "Memo",
            },
            children: []
          },
          {
            path: "review",
            name: "review-manage",
            component: ReviewManage,
            meta: {
              name: "审核管理",
              icon: "MessageBox",
            },
            children: []
          },
        ],
      },
      {
        path: "returnGoods",
        name: "return-goods",
        component: ReturnGoods,
        meta: {
          name: "退货管理",
          icon: "CollectionTag",
        },
        children: []
      },
    ]
  },
  {
    path: "/goods",
    component: Goods,
    name: "goods",
    meta: {
      name: "产品管理",
      icon: "IceTea",
    },
    children: [
      {
        path: "list",
        name: "goods-list",
        component: GoodsList,
        meta: {
          name: "产品列表",
          icon: "Tickets",
        },
        children: []
      },
      {
        path: "classify",
        name: "goods-classify",
        component: GoodsClassify,
        meta: {
          name: "产品分类",
          icon: "ScaleToOriginal",
        },
        children: []
      },
    ],
  }
]
export default dynamicRoutes;